package com.aternity.vbd.collect;

import org.apache.commons.lang.StringUtils;

/**
 * @author Daniel Orr
 */
public interface ScriptSplittingStrategy {
    String[] getCommands(String script);

    public static final ScriptSplittingStrategy semicolonSplitter = new ScriptSplittingStrategy() {
        @Override
        public String[] getCommands(String script) {
            return StringUtils.split(script, ";");
        }
    };

    public static final ScriptSplittingStrategy customSplitter = new ScriptSplittingStrategy() {
        @Override
        public String[] getCommands(String script) {
            return StringUtils.splitByWholeSeparator(script, "--#");
        }
    };

}
